﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReNameEx.Model
{
    public class ReExFile : INotifyPropertyChanged
    {
        /// <summary>
        /// 是否应用
        /// </summary>
        private bool _IsApply = true;
        public virtual bool IsApply
        {
            get { return _IsApply; }
            set { _IsApply = value; OnPropertyChanged("IsApply"); }
        }

        /// <summary>
        /// 名称
        /// </summary>
        public string FileName { get; set; } = string.Empty;

        /// <summary>
        /// 新名称
        /// </summary>
        public string NewFileName { get; set; } = string.Empty;

        /// <summary>
        /// 路径
        /// </summary>
        public string FilePath { get { return Path.Combine(DirPath, FileName); } }

        /// <summary>
        /// 所在目录
        /// </summary>
        public string DirPath { get; set; } = string.Empty;


        public event PropertyChangedEventHandler? PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
